<extend name="template/base_index" />

<block name="area_header">

</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <a class="btn btn-primary btn-sm" href="{:U('Admin/BbsForum/add',array('fup'=>I('fup',0)))}">添加版块</a>
            <a class="btn btn-success btn-sm ajax-post" href="{:U('Admin/BbsForum/count')}"  target-form="subform_recount">重新统计</a>
            <php>if(isset($_GET['fup']))echo '<a class="btn btn-default btn-sm" href="javascript:history.go(-1);">返回</a>';</php>
            <div class="subform_recount hide"></div>
            <table class="table table-striped table table-hover  table-condensed">
                <thead>
                <tr>
<th><input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />FID</th>
<th>版块名称</th>
<th>发帖数-回帖数</th>
<th>版主</th>
<th>审核</th>
<th>状态</th>
<th>操作</th>
                </tr>
                </thead>
                <tbody>
                <empty name="list">
                    <tr>
                        <td colspan="5" class="text-center">{:L('NO_DATA')}</td>
                    </tr>
                    <else/>
                    <volist name="list" id="vo">
                        <div class="subform_{$vo.fid} hide" >
                            <input type="hidden" name="fid" value="{$vo.fid}"/>
                            <input type="hidden" name="modnewposts" value="<eq name='vo.modnewposts' value='1'>0<else/>1</eq>"/>
                        </div>
                        <tr>
                            <td>
                                <input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" />{$vo.fid}
                            </td>
                            <td class="text-ellipsis">
                                {$vo.name}<a href="{:getImgUrl($vo['icon_id'])}" target="_blank" title="点击查看原图" class="pull-right" data-toggle="tooltip">                                <img  class="thumbnail" src="{:getImgUrl($vo['icon_id'],60)}" width="60"/></a>
                            </td>
                            <td>
                                {$vo.threads}-{$vo.posts}
                            </td>
                            <td><a href="{:U('Admin/BbsForum/admin',array('fid'=>$vo['fid']))}" class="btn btn-sm btn-primary">管理</a><volist name="vo['admin']" id="v">
                                【<a href="{:U('Admin/CustomerInfo/index',array('id'=>$v['uid']))}" target="_blank">{$v.nickname}</a>/{$v.uid}】
                            </volist>
                            </td>
                            <td>
                                <if condition="$vo.modnewposts eq 1" >
                                    开启 <a href="{:U('Admin/BbsForum/modnewposts')}" target-form="subform_{$vo.fid}" class="btn btn-sm btn-danger ajax-post">关闭</a>
                                    <else/>
                                    关闭 <a href="{:U('Admin/BbsForum/modnewposts')}" target-form="subform_{$vo.fid}" class="btn btn-sm btn-success ajax-post">开启</a>
                                </if>
                            </td>
                            <td><form class="forumstatus"></form><switch name="vo.status">
                                <case value="0">开启 <a href="{:U('Admin/BbsForum/status',array('status'=>1,'fid'=>$vo['fid']))}" target-form="forumstatus" class="btn btn-sm btn-warning ajax-post">锁定</a> <a href="{:U('Admin/BbsForum/status',array('status'=>-1,'fid'=>$vo['fid']))}" target-form="forumstatus" class="btn btn-sm btn-primary ajax-post">关闭</a></case>
                                <case value="1">锁定 <a href="{:U('Admin/BbsForum/status',array('status'=>0,'fid'=>$vo['fid']))}"  target-form="forumstatus" class="btn btn-sm btn-success ajax-post">开启</a> <a href="{:U('Admin/BbsForum/status',array('status'=>-1,'fid'=>$vo['fid']))}"  target-form="forumstatus" class="btn btn-sm btn-primary ajax-post">关闭</a></case>
                                <case value="-1">关闭 <a href="{:U('Admin/BbsForum/status',array('status'=>0,'fid'=>$vo['fid']))}"  target-form="forumstatus" class="btn btn-sm btn-success ajax-post">开启</a> <a href="{:U('Admin/BbsForum/status',array('status'=>1,'fid'=>$vo['fid']))}"  target-form="forumstatus" class="btn btn-sm btn-warning ajax-post">锁定</a></case>
                                <default />未知
                             </switch>
                            </td>
                            <td>
                                <a href="{:U('Admin/BbsForum/edit',array('fid'=>$vo['fid'],'fup'=>$vo['fup']))}" class="btn btn-sm btn-primary"><i class="fa fa-edit"></i>{:L('BTN_EDIT')}</a>
                               <!--  <a href="{:U('Admin/BbsForum/index',array('fup'=>$vo['fid']))}" class="btn btn-sm btn-warning">子版块</a> -->
                            </td>
                        </tr>
                        
                        
                        <volist name="vo['child']" id="v">
                            <div class="subform_{$v.fid} hide" >
                            <input type="hidden" name="fid" value="{$v.fid}"/>
                            <input type="hidden" name="modnewposts" value="<eq name='v.modnewposts' value='1'>0<else/>1</eq>"/>
                        </div>
                        <tr>
                            <td>
                                <!-- <input type="checkbox" value="{$v.id}" name="ids[]" class="selectitem" /> -->&nbsp;&nbsp;&nbsp;&nbsp;|__{$v.fid}
                            </td>
                            <td class="text-ellipsis">|__{$v.name}<a href="{:getImgUrl($v['icon_id'])}" target="_blank" title="点击查看原图" class="pull-right" data-toggle="tooltip">                                <img  class="thumbnail" src="{:getImgUrl($v['icon_id'],60)}" width="60"/></a>
                            </td>
                            <td>
                                {$v.threads}-{$v.posts}
                            </td>
                            <td><a href="{:U('Admin/BbsForum/admin',array('fid'=>$v['fid']))}" class="btn btn-sm btn-primary">管理</a><volist name="v['admin']" id="vv">
                                【<a href="{:U('Admin/CustomerInfo/index',array('id'=>$vv['uid']))}" target="_blank">{$v.nickname}</a>/{$v.uid}】
                            </volist>
                            </td>
                            <td>
                                <if condition="$v.modnewposts eq 1" >
                                    开启 <a href="{:U('Admin/BbsForum/modnewposts')}" target-form="subform_{$v.fid}" class="btn btn-sm btn-danger ajax-post">关闭</a>
                                    <else/>
                                    关闭 <a href="{:U('Admin/BbsForum/modnewposts')}" target-form="subform_{$v.fid}" class="btn btn-sm btn-success ajax-post">开启</a>
                                </if>
                            </td>
                            <td><form class="forumstatus"></form><switch name="vo.status">
                                <case value="0">开启 <a href="{:U('Admin/BbsForum/status',array('status'=>1,'fid'=>$v['fid']))}" target-form="forumstatus" class="btn btn-sm btn-warning ajax-post">锁定</a> <a href="{:U('Admin/BbsForum/status',array('status'=>-1,'fid'=>$v['fid']))}" target-form="forumstatus" class="btn btn-sm btn-primary ajax-post">关闭</a></case>
                                <case value="1">锁定 <a href="{:U('Admin/BbsForum/status',array('status'=>0,'fid'=>$v['fid']))}"  target-form="forumstatus" class="btn btn-sm btn-success ajax-post">开启</a> <a href="{:U('Admin/BbsForum/status',array('status'=>-1,'fid'=>$v['fid']))}"  target-form="forumstatus" class="btn btn-sm btn-primary ajax-post">关闭</a></case>
                                <case value="-1">关闭 <a href="{:U('Admin/BbsForum/status',array('status'=>0,'fid'=>$v['fid']))}"  target-form="forumstatus" class="btn btn-sm btn-success ajax-post">开启</a> <a href="{:U('Admin/BbsForum/status',array('status'=>1,'fid'=>$v['fid']))}"  target-form="forumstatus" class="btn btn-sm btn-warning ajax-post">锁定</a></case>
                                <default />未知
                             </switch>
                            </td>
                            <td>
                                <a href="{:U('Admin/BbsForum/edit',array('fid'=>$v['fid'],'fup'=>$v['fup']))}" class="btn btn-sm btn-primary"><i class="fa fa-edit"></i>{:L('BTN_EDIT')}</a>
                                <!-- <a href="{:U('Admin/BbsForum/index',array('fup'=>$v['fid']))}" class="btn btn-sm btn-warning">子版块</a> -->
                            </td>
                        </tr>
                        </volist>
                    </volist>
                </empty>
                </tbody>
            </table>
            <div>{$show}</div>
        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
</block>

<block name="area_footer">

</block>
